<?php
namespace app\index\validate;

use think\Validate;

/**
 * 用户验证
 * Class User
 * @package app\index\validate
 */
class User extends Validate
{
    protected $rule = [
        'username'         => 'unique:user',
        'password'         => 'confirm:confirm_password',
        'confirm_password' => 'confirm:password',
        'tel'              => 'number|length:11',
        'email'            => 'email',
    ];

    protected $message = [
        'username.unique'          => '用户名已存在',
        'password.confirm'         => '两次输入密码不一致',
        'confirm_password.confirm' => '两次输入密码不一致',
        'tel.number'               => '手机号格式错误',
        'tel.length'               => '手机号长度错误',
        'email.email'              => '邮箱格式错误',
    ];
}